﻿using System;
using System.Reflection;
using System.Resources;
using System.Windows;

namespace EASEater
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;

            Welcome w1 = new Welcome();
            w1.Show();
        }

        System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
        {
            if (args.Name.Contains("Oracle"))
            {
                ResourceManager resource = new ResourceManager("EASEater.Properties.Resources", Assembly.GetExecutingAssembly());
                var objBytes = (byte[])resource.GetObject("Oracle_ManagedDataAccess");
                return AppDomain.CurrentDomain.Load(objBytes);
            }
            return null;
        }
    }
}
